﻿/*
 * Created by SharpDevelop.
 * User: XPMUser
 * Date: 11/02/2011
 * Time: 11:10
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Windows;
using System.Windows.Data;

namespace KDG.FoldersSize4
{
	/// <summary>
	/// Description of InverseVisibilityOfBool.
	/// </summary>
	[ValueConversion(typeof(bool), typeof(bool))]
    public class InverseVisibilityOfBool: IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter,
            System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(Visibility))
                throw new InvalidOperationException("The target must be a Visibility");

            if((bool)value)
            	return Visibility.Collapsed;
            
            return Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter,
            System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        #endregion
    }
}
